<template>
  <div>
    <NavBar :title="title" />
    <div class="content-top">
      <ul class="resume-corvidae">
        <!-- <li>
          <label>上传头像</label>
          <span>去完善</span>
        </li> -->
        <li v-if="!finishInfo.havEvluation" @click="onAddClick('自我评价')">
          <label>自我评价</label>
          <span>去完善</span>
        </li>
        <li v-if="!finishInfo.havSkill" @click="onAddClick('专业技能')">
          <label>专业技能</label>
          <span>去完善</span>
        </li>
        <li v-if="!finishInfo.havLicense" @click="onAddClick('所获证书')">
          <label>所获证书</label>
          <span>去完善</span>
        </li>
        <li v-if="!finishInfo.havAddInfo" @click="onAddClick('附加信息')">
          <label>附加信息</label>
          <span>去完善</span>
        </li>
      </ul>

      <div style="margin: 26px 20px 0">
        <van-button type="primary" block color="#05A6F0" round style="font-size: 18px" text="完成" @click="onFinish"></van-button>
      </div>
    </div>
  </div>
</template>

<script>
import NavBar from "@/components/NavBar.vue";
import { Button } from "vant";
import Global from '@/Global';
export default {
  name: "ResumeQuick4",
  components: {
    NavBar,
    [Button.name]: Button,
  },
  props: ["title"],
  // 定义属性
  data() {
    return {
      finishInfo: {},
    };
  },
  mounted() {
    this.getInfo();
		this.$bus.$on(Global.bus_person_resume_update,()=>{
			this.getInfo();
		})
  },
  // 方法集合
  methods: {
    getInfo() {
      this.$api.get('/Resume/GetResumeFillStatus').then(res => {
        if (res.success) {
          this.finishInfo = res.response;
        }
      })
    },
    onAddClick(item) {
      if (item === "求职意向") {
        this.onJobWantedClick();
      } else if (item === "教育经历") {
        this.onEduInfoClick(null);
      } else if (item === "工作经历") {
        this.onWorkClick(null);
      } else if (item === "自我评价") {
        this.$router.push({ name: "person-resume-self", params: { data: null } });
      } else if (item === "专业技能") {
        this.$router.push({ name: "person-resume-skill", params: { data: item }, });
      } else if (item === "所获证书") {
        this.$router.push({ name: "person-resume-zs", params: { data: item } });
      } else if (item === "附加信息") {
        this.$router.push({ name: "person-resume-addinfo", params: { data: item }, });
      }
    },
    onFinish() {
      this.$router.replace({name:'person-main'})
    },
  },
};
</script>

<style>
.resume-corvidae {
  display: flex;
  flex-direction: column;
  padding-left: 20px;
  background-color: #fff;
}

.resume-corvidae li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 54px;
  padding-right: 20px;
  border-bottom: 0.5px solid #e8e8e8;
}

.resume-corvidae li label {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  line-height: 100%;
}

.resume-corvidae li span {
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 30px;
  background: -webkit-linear-gradient(left, #f90, #05A6F0);
  background: -o-linear-gradient(right, #f90, #05A6F0);
  background: -moz-linear-gradient(right, #f90, #05A6F0);
  background: linear-gradient(to right, #f90, #05A6F0);
  font-size: 13px;
  color: #fff;
  line-height: 24px;
}
</style>
